<?php

function __autoload($class_name) 
{
    require_once "$class_name.class.php";
}

$parrainage=new SplObjectStorage(); 
for ($i=1;$i<3;$i++) {
	$p=new Profil("profil_$i");
	$parrainage->attach($p);
}

echo "\n\nNb element: ".count($parrainage)."\n";
$parrainage->rewind();
while($parrainage->valid()) {
    $index  = $parrainage->key();
    $object = $parrainage->current(); 
  
	echo "######################################\n";
	echo "Index: $index\n";
	echo "Valeur: $object\n";
	$parrainage->next();
}

echo "\n######################################\n";
print_r($parrainage);
echo "######################################\n";
?>
